/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package quanlykho;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Admin
 */
public class Ketnoi {

    public Ketnoi() {
    }
    Connection con;
    public Connection connect()
    {
        try {
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            con = DriverManager.getConnection("jdbc:sqlserver://localhost;databaseName=quanlykho;user=sa;password=123456");
            
        } catch (SQLException ex) {
            Logger.getLogger(Ketnoi.class.getName()).log(Level.SEVERE, null, ex);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Ketnoi.class.getName()).log(Level.SEVERE, null, ex);
        }
        return con;
    }
}
